package com.yanboo.modules.mnt.service;

import com.yanboo.modules.mnt.domain.Processor;
import com.yanboo.modules.mnt.service.dto.ProcessorDto;
import com.yanboo.modules.mnt.service.dto.ProcessorQueryCriteria;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.io.IOException;
import jakarta.servlet.http.HttpServletResponse;
import com.yanboo.common.utils.PageResult;

/**
 * @description 服务接口
 * @author fdq
 * @date 2024-03-27
 **/
public interface ProcessorService {

    /**
     * 查询数据分页
     * @param criteria 条件
     * @param pageable 分页参数
     * @return Map<String,Object>
     */
    PageResult<ProcessorDto> queryAll(ProcessorQueryCriteria criteria, Pageable pageable);

    /**
     * 查询所有数据不分页
     * @param criteria 条件参数
     * @return List<ProcessorDto>
     */
    List<ProcessorDto> queryAll(ProcessorQueryCriteria criteria);

    /**
     * 根据ID查询
     * @param id ID
     * @return ProcessorDto
     */
    ProcessorDto findById(Long id);

    /**
     * 创建
     * @param resources /
     */
    void create(Processor resources) throws IOException, InterruptedException;

    /**
     * 编辑
     * @param resources /
     */
    void update(ProcessorDto resources);

    /**
     * 多选删除
     * @param ids /
     */
    void deleteAll(Long[] ids);

    /**
     * 导出数据
     * @param all 待导出的数据
     * @param response /
     * @throws IOException /
     */
    void download(List<ProcessorDto> all, HttpServletResponse response) throws IOException;

    void execAsync(ProcessorDto processor) throws IOException, InterruptedException;

    void destroy(ProcessorDto processor);

    void destroyForcibly(ProcessorDto processor);

    void reAttach();
}
